<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ page isELIgnored="false"%>
<%
    String path = request.getContextPath();
%>
<!DOCTYPE html>
<html>
<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">


<title>李宁体育管理系统</title>

<link rel="shortcut icon" href="favicon.ico">
<link href="<%=path%>/css/bootstrap.min14ed.css?v=3.3.6"
	rel="stylesheet">
<link href="<%=path%>/css/font-awesome.min93e3.css?v=4.4.0"
	rel="stylesheet">
<link href="<%=path%>/css/style.min862f.css?v=4.1.0" rel="stylesheet">
<link href="<%=path%>/css/plugins/chosen/chosen.css" rel="stylesheet">

<link
	href="<%=path%>/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css"
	rel="stylesheet">
<link href="<%=path%>/css/animate.min.css" rel="stylesheet">

</head>

<body class="gray-bg ">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<form role="form" id="queryForm" class="form-inline">
							<div class="form-group">
							<input id="tagId" type="hidden"  value="${tagId }" >
							<input id="id" type="hidden"  value="${id }" >
								<input class="form-control" type="text" style="width: 250px;"
									id="tagName" name="tagName" value="${tagName}"
									placeholder="标签名称" />
							</div>
							<span id="errorMsg" style="color: red"></span>
							<div class="input-group">
								<button class="btn btn-primary" type="button"
									style="margin-bottom: 0px;" onclick="search();">
									<i class="fa fa-search"></i>&nbsp;保存
								</button>
							</div>
						</form>

					</div>
				</div>
			</div>
	</div>
	</div>
	<script src="<%=path%>/js/jquery.min.js?v=2.1.4"></script>
	<script src="<%=path%>/js/bootstrap.min.js"></script>
	<script src="<%=path%>/js/plugins/layer/layer.js"></script>
	<script src="<%=path%>/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
	<script type="text/javascript">
	var goback=function(){
		var index=parent.layer.getFrameIndex(window.name);

		parent.layer.close(index);
		window.location.href="<%=path%>/weixin/fansTag"
	}
	var search=function(){
	var flage=false;
	var tagName=$("#tagName").val();
	var tagId=$("#tagId").val();
	var id=$("#id").val();
	if(null!=tagName&&''!=tagName){
		flage=true;
		if(flage){
			if(tagId){
			   $.ajax({
   	            url: "<%=path%>/weixin/updateWxFansTag",
   	            type: "post",
   	            data: {"tagId":tagId ,"id":id,"tagName":tagName},
   	            dataType: "json",
   	            success: function (note) {
   	            	/*  goback(); */ 
   	            	
   	            	window.parent.location.href="<%=path%>/weixin/fansTag";
   	               
   	            },
   	            error: function () {
   	            	$("#errorMsg").html("修改异常，请稍后重试");
   	            }

   	        });
			}else{
				$.ajax({
	   	            url: "<%=path%>/weixin/addWxFansTag",
	   	            type: "post",
	   	            data: {"tagName":tagName},
	   	            dataType: "json",
	   	            success: function (note) {
	   	            	window.parent.location.href="<%=path%>/weixin/fansTag";
	   	                /* $table.bootstrapTable('refresh'); */
	   	            },
	   	            error: function () {
	   	            	$("#errorMsg").html("新增异常，请稍后重试");
	   	            }

	   	        });
			}			
			
		}
	}else{
		flage=false;
		$("#errorMsg").html("标签不能为空");
	}
	
	}
	
	</script>
</body>
</html>
